<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>axios</title>
  <script src="js/axios-0.18.0.js"></script>
</head>
<body>

<input type="button" value="获取数据" onclick="getData()">
<input type="button" value="set数据" onclick="setData()">
<div id="div1"></div>

</body>
<script>

  function getData(){
    axios.get("http://192.168.137.1:8080/login admin").then(result => {
      document.getElementById("div1").innerHTML=result.data[1].account;
    })
  }
  function setData(){
    const data = {
      account:"1",
      password:"21"
    };
    axios.post("http://192.168.137.1:8080/login admin",data).then(result => {
      console.log("成功")
    })
  }


</script>
</html>